package com.wocao.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 小区
 *
 * @since 2023-11-29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("zy_community")
public class ZyCommunity {

  @ExcelProperty("小区ID")
  @TableId(type = IdType.AUTO)
  @JsonSerialize(using= ToStringSerializer.class)
  private long communityId;
  @ExcelProperty("小区名称")
  private String communityName;

  @ExcelProperty("小区编码")
  @JsonSerialize(using= ToStringSerializer.class)
  private String communityCode;

  @ExcelProperty("省区划码")
  private String communityProvenceCode;
  @ExcelProperty("市区划码")
  private String communityCityCode;
  @ExcelProperty("县区划码")
  private String communityTownCode;
  @ExcelProperty("详细地址")
  private String communityDetailedAddress;
  @ExcelProperty("经度")
  private String communityLongitude;
  @ExcelProperty("纬度")
  private String communityLatitude;
  @ExcelProperty("物业id")
  private long deptId;
  @ExcelProperty("排序")
  private long communitySort;
  @ExcelProperty("创建者")
  private String createBy;
  @ExcelProperty("创建时间")
  @ColumnWidth(20)
  private LocalDateTime createTime;
  @ExcelProperty("修改者")
  private String updateBy;
  @ExcelProperty("修改时间")
  @ColumnWidth(20)
  private LocalDateTime updateTime;
  @ExcelProperty("备注")
  private String remark;

  //省名
  @ExcelProperty("省名")
  @TableField(exist = false)
  private String dartName;
  //城市名
  @ExcelProperty("市名")
  @TableField(exist = false)
  private String cityName;
  //区/县名
  @ExcelProperty("县名")
  @TableField(exist = false)
  private String countyName;

}
